#ifndef PM_WIZARD_NEW_PROJECT_H_INCLUDED
#define PM_WIZARD_NEW_PROJECT_H_INCLUDED

#include "wizardnewprojectgui.h"
#include <wx/wizard.h>
#include "pm/task.h"

/**
 * \class WizardPageProjectName
 */
class WizardPageProjectName : public WizardPageProjectNameGui
{
public:
	WizardPageProjectName(wxWindow* parent);
	
	wxString GetFileName() const { return m_fpFile->GetPath(); }
	
	virtual bool TransferDataFromWindow();
};


/**
 * \class WizardPageWorkRequest
 */
class WizardPageWorkRequest : public WizardPageWorkRequestGui
{
public:
	WizardPageWorkRequest(wxWindow* parent);
	
	wxString GetWRName() const { return m_editName->GetValue(); }
	double GetAmount() const;
	wxDateTime GetDate() const { return m_dpDate->GetValue(); }

	virtual bool TransferDataFromWindow();
};


/**
 * \class WizardPageTasks
 */
class WizardPageTasks : public WizardPageTasksGui
{
	enum COLS {
		COL_NAME,
		COL_UNIT_COST,
		COL_QUANTITY,
		COL_COST,
		COL_DATE
	};
	
public:
	WizardPageTasks(wxWindow* parent);
	~WizardPageTasks();
	
	void GetTasks(pm::ListTask& tasks);

	virtual bool TransferDataFromWindow();

protected:
	pm::Task* GetTask(long item);
	void AddTask(const pm::Task& task);
	void SetTask(long item, const pm::Task& task);

	virtual void OnBtnAdd( wxCommandEvent& event );
	virtual void OnBtnDel( wxCommandEvent& event );
	virtual void OnBtnEdit( wxCommandEvent& event );
};


/**
 * \class WizardNewProject
 */
class WizardNewProject : public wxWizard
{
    wxWizardPageSimple* m_page1;
	
	WizardPageProjectName* m_panelName;
	WizardPageWorkRequest* m_panelWorkRequest;
	WizardPageTasks*       m_panelTasks;
	
	wxString               m_filename;
	
public:
    WizardNewProject(wxWindow* parent);

    wxWizardPage* GetFirstPage() const { return m_page1; }
	
	const wxString& GetFileName() const { return m_filename; }
	
protected:
	void SetPagePanel(wxWizardPage* page, wxPanel* panel);
	
	void OnFinished(wxWizardEvent& event);
};


#endif // PM_WIZARD_NEW_PROJECT_H_INCLUDED
